﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FX_API.Models;
using FX_API.Request;

namespace BamaTeaWebAPI.Services
{
    public class FXLeadsQueryService : FXBaseQueryService<FXLeadsObj>
    {
        protected override string ApiName => "LeadsObj";

        protected override string MethodDescription => "从纷享获取线索信息";

        public FXLeadsObj GetLeadByTel(string tel)
        {
            List<FiltersItem> filters = new List<FiltersItem>()
            {
                new FiltersItem()
                {
                    field_name = "tel",
                    field_values = new List<string>() { tel },
                    _operator = "EQ"
                }
            };

            var leads = GetAllInfo(filters);

            if (leads.Count == 0) return null;
            return leads[0];
        }
    }

    public class FXLeadsObj : FXBaseEntity
    {

    }
}